<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>挺赞洗衣</title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
	<link rel="stylesheet" href="__PUBLIC__/client/css/cui.css?sj={$tj}" />
	<link rel="stylesheet" href="__PUBLIC__/client/css/slick.css?sj={$tj}" />
	<link rel="stylesheet" href="__PUBLIC__/client/css/style.css?sj={$tj}" />
	<script type="text/javascript" src="__PUBLIC__/client/js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/client/js/lib.js?sj={$tj}"></script>
</head>
<body class="mhome">
	<div class="viewport">
		<!--<div class="sitemap">
			<a href="{:U('Client/wo/woinfo')}" class="goback"></a>选择地区
		</div>-->
		<!--end header-->
		<div id="bd" class="bd9 fix">
            <p class="loc-txt p1">定位到的位置</p>
            <p class="loc"><img src="__PUBLIC__/client/images/loaction_150_150.png" alt=""><span id="areas" class="addarea" data-chengshi=" ">上海 闵行</span><span id="getLocation" style="float: right; margin-right: 10px;">定位</span></p>
            <p class="tit-loc p1">全部</p>
            <div class="loc-list">
            	
            	
            		<foreach name="area" item="vo" key="k" >
            			<foreach name="vo._data" item="vo1" key="ks" >
            				<if condition="$ks elt 63">
            					<div class="province">{$vo1.title}</div>
            					<div class="sub-province fix">
	            					<foreach name="vo1._data" item="vo2" >
	            						 <a style="width:auto; display:inline;margin-left: 13px;" class="addarea" data-chengshi="{$vo.title}" href="javascript:;">{$vo2.title}</a>
	            					</foreach>
            					</div>
            					
            				</if>
            			</foreach>
            			
            			<if condition="$ks egt 219 && $ks elt 3266">
            				<div class="province">{$vo.title}</div>
            				<div class="sub-province fix">
	            					<foreach name="vo._data" item="vo3" >
	            						 <a style="width:auto; display:inline;margin-left: 13px;" class="addarea" data-chengshi="{$vo.title}" href="javascript:;">{$vo3.title}</a>
	            					</foreach>
            				</div>
            				
            			</if>
            		</foreach>
   
            </div>

		</div>
		<div class="c"></div>
		<!--end #bd-->
	</div>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script src="__PUBLIC__/business/js/normal.js"></script>
<script>
  wx.config({
    //debug: true,
    appId: '{$jsapi.appId}',
    timestamp: '{$jsapi.timestamp}',
    nonceStr: '{$jsapi.nonceStr}',
    signature: '{$jsapi.signature}',
    jsApiList: [
      	//所有要调用的 API 都要加到这个列表中
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',
        'translateVoice',
        'startRecord',
        'stopRecord',
        'onRecordEnd',
        'playVoice',
        'pauseVoice',
        'stopVoice',
        'uploadVoice',
        'downloadVoice',
        'chooseImage',
        'previewImage',
        'uploadImage',
        'downloadImage',
        'getNetworkType',
        'openLocation',
        'getLocation',
        'hideOptionMenu',
        'showOptionMenu',
        'closeWindow',
        'scanQRCode',
        'chooseWXPay',
        'openProductSpecificView',
        'addCard',
        'chooseCard',
        'openCard'
    ]
  });

wx.ready(function () {
	  //  获取当前地理位置
	  document.querySelector('#getLocation').onclick = function () {
	    wx.getLocation({
	      success: function (res) {
	      		 var tourl="{:U('Client/api/edit_area')}";
       			 $.post(tourl,res,function(data){
       			 	if(data.status==1){
       			 		$('#areas').html(data.msg);
       			 	}else{
       			 		Msg('请检查您的GPS定位是否开启!',2);
       			 	}
				 });
	      },
	      cancel: function (res) {
	      		
	      }
	    });
	  };
	
	
});

$(function(){
	//========
	$('.addarea').on('click',function(){
		var qx=$(this).html();
		var cs=$(this).attr('data-chengshi');
		var tourl="{:U('Client/api/edit_user')}";
		var data={id:'{$session.user.id}',area:cs+' '+qx}
		 $.post(tourl,data,function(data){
		    if(data.status!=1){
		    		Msg('更该失败!',2);
		    }else{
		    		window.location.href="{:U('Client/wo/woinfo')}";
		    }
		 });
	});
	//===========
})
</script>
</body>
</html>